package com.five.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.five.pojo.ClubPeople;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author lenovo
 */
@Mapper
public interface ClubPeopleDao{

    @Select("select * from clubPeople where c_club=#{cClub};")
    List<ClubPeople> findBycClub(String cClub);

    @Delete("delete from clubPeople where id=#{id}")
    void deleteById(Integer id);

    @Insert("insert into clubPeople(c_club , s_name , s_number , s_gender , s_phone , c_joinclubtime) values " +
            "(#{cClub} , #{sName} , #{sNumber} , #{sGender} , #{sPhone} , #{cJoinClubTime})")
    void addStudent(ClubPeople clubPeople);

    List<ClubPeople> list(String cClub, String sName);
}
